package com.rainbowBoot.login.dao.impl;

import com.rainbowBoot.common.BaseDao;
import com.rainbowBoot.login.Model.User;
import com.rainbowBoot.repository.UserRepository;
import com.rainbowBoot.login.dao.LoginDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class LoginDaoImpl extends BaseDao implements LoginDao {

    // jdbc连接
    @Autowired
    private JdbcTemplate jdbc;

    // user类JPA
    private UserRepository userRepository;

    /**
     * 查询登陆人信息
     * @param username
     * @param password
     * @return
     */
    @Override
    public List<Map<String,Object>> login(String username, String password) {
        User us = new User();
        us.setUsername(username);
        us.setPassword(password);
        return super.query(us);
    }
}
